#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
策略配置与工具函数
提供统一的策略列表与名称映射，避免各处重复定义
"""

from typing import List, Tuple, Dict


# 统一维护的策略列表：(英文名, 中文名)
STRATEGY_LIST: List[Tuple[str, str]] = [
    ('breakout_platform', '平台突破策略'),
    ('airfield_strategy', '停机坪策略'),
    ('volume_limit_down', '放量跌停策略'),
    ('flag_pattern', '旗形突破策略'),
    ('four_up_three_down', '四连板两连跌策略'),
    ('double_bottom', '双底(W底)突破策略'),
    ('head_shoulder_bottom', '头肩底突破策略'),
    ('rounding_bottom', '圆弧底突破策略'),
    ('morning_star', '早晨之星策略'),
    ('v_shape_bottom', 'V形底策略'),
    ('latent_bottom', '潜伏底策略'),
    ('rising_flag', '上升旗形策略'),
    ('morning_sun', '旭日东升策略'),
    ('cup_with_handle', '杯柄形态策略'),
    ('triangle_breakout', '三角形突破策略'),
    ('volume_breakout', '放量突破策略'),
    ('rectangle_breakout', '矩形整理突破策略'),
    ('low_breakout_strategy', '低位突破策略'),
    ('high_breakout_strategy', '高位突破策略'),
    ('low_volume_rise_with_stable_baseline', '缩量拉涨策略(前期波动平稳)'),
    ('ma_crossover', '均线金叉策略(5日线上穿20日线)'),
    ('limit_up_then_down', '涨停后收阴策略'),
    ('three_yin_not_break_yang', '回调：三阴不破阳策略'),
    ('limit_up_rubbing_line', '回调：涨停揉搓线策略'),
    ('limit_up_shrinking_volume', '回调：涨停缩倍量策略'),
    ('oversold_rebound_technical_turning_point', '超跌反弹+技术拐点策略'),
    ('limit_up_pullback_restart_strategy', '涨停回调再启动策略'),
]


def get_strategy_list() -> List[Tuple[str, str]]:
    return STRATEGY_LIST


def get_strategy_chinese_map() -> Dict[str, str]:
    return {en: zh for en, zh in STRATEGY_LIST}


def get_chinese_name(strategy_name: str) -> str:
    mapping = get_strategy_chinese_map()
    return mapping.get(strategy_name, strategy_name)


